package com.tongjie.hotelbooking.checkinperson.entity;

import com.tongjie.hotelbooking.checkinperson.enums.CheckInPersonType;
import com.tongjie.hotelbooking.order.entity.Order;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.*;
import java.io.Serializable;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Entity
@Table(name = "hb_check_in_person")
public class CheckInPerson implements Serializable {

    private static final long serialVersionUID = -5913717184859204603L;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "order_id")
    private Order order;

    @Column
    private String personName;

    @Column
    @Enumerated(EnumType.STRING)
    private CheckInPersonType personType;


}
